//表单的提交事件
$('.form').submit(function () {
    //
    var username = $('input[name="username"]').val();
    var password = $('input[name="password"]').val();


    obajax.post(
        '/api/user/login',//登录的接口
        {username, password},
        (result) => {
            //成功跳转主页
            window.location.href = "/";
            //提示错误的信息
        }
    )
    //阻止表单的自动提交
    return false;

});